home *** CD-ROM | disk | FTP | other *** search
/ Champak 49 / Volume 49 - JOGO DISK .iso / Games / hungerstrike.swf / scripts / __Packages / actionscript / Trail.as < prev    next >
Encoding:
Text File  |  2007-09-28  |  1.6 KB  |  65 lines

  1. class actionscript.Trail extends MovieClip
  2. {
  3.    var hAreas;
  4.    var wHitAreaCounter;
  5.    var game;
  6.    function Trail()
  7.    {
  8.       super();
  9.       this._x = 0;
  10.       this._y = 0;
  11.       this.hAreas = 14;
  12.       this.wHitAreaCounter = 1;
  13.       this.game = this._parent;
  14.       var _loc3_ = 1;
  15.       while(_loc3_ <= this.hAreas)
  16.       {
  17.          this["c" + _loc3_]._hit = false;
  18.          this["c" + _loc3_]._visible = false;
  19.          this["h" + _loc3_]._visible = false;
  20.          _loc3_ = _loc3_ + 1;
  21.       }
  22.    }
  23.    function isColliding(mMc)
  24.    {
  25.       if(mMc == undefined)
  26.       {
  27.          return undefined;
  28.       }
  29.       var _loc2_ = 1;
  30.       while(_loc2_ <= this.hAreas)
  31.       {
  32.          if(mMc.hitTest(this["h" + _loc2_]))
  33.          {
  34.             return true;
  35.          }
  36.          _loc2_ = _loc2_ + 1;
  37.       }
  38.       _loc2_ = 1;
  39.       while(_loc2_ < this.wHitAreaCounter)
  40.       {
  41.          if(mMc.hitTest(this["WeaponHitArea" + _loc2_]))
  42.          {
  43.             return true;
  44.          }
  45.          _loc2_ = _loc2_ + 1;
  46.       }
  47.    }
  48.    function attachWeaponHitArea(nX, nY, mW)
  49.    {
  50.       mW._wCounter = this.wHitAreaCounter;
  51.       this.attachMovie("WeaponHitArea","WeaponHitArea" + this.wHitAreaCounter,this.getNextHighestDepth(),{_x:nX,_y:nY,_alpha:0});
  52.       this.wHitAreaCounter = this.wHitAreaCounter + 1;
  53.    }
  54.    function removeWeaponHitAreas()
  55.    {
  56.       var _loc2_ = 1;
  57.       while(_loc2_ <= this.wHitAreaCounter)
  58.       {
  59.          this["WeaponHitArea" + _loc2_].removeMovieClip();
  60.          _loc2_ = _loc2_ + 1;
  61.       }
  62.       this.wHitAreaCounter = 1;
  63.    }
  64. }
  65.